<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/includes/common.jsp" %>

${action.message}

<form method="get">
ID người dùng:
<input type="text" name="id" value="${param.id}" />
<button type="submit">Xem</button>
</form>

<c:if test="${not empty action.user}">
<form method="post">
<input type="hidden" name="id" value="${param.id}"/>
<div>
    <div class="form-left">Cơ sở tri thức:</div>
    <div class="form-right">
        <textarea name="kb" rows="20" cols="25">${action.user.knowledgeBase.value}</textarea>
    </div>
</div>
<div class="form-actions">
    <button type="submit" name="submit" value="save">Lưu</button>
    <button type="reset">Nhập lại</button>
</div>
<div>
    <div class="form-left">Bữa ăn đã dùng:</div>
    <div class="form-right">
    <table>
	    <c:forEach var="meal" items="${action.user.usedMeals}">
	    <tr>
	       <td>${meal.dishes}</td>
	       <td>${meal.takenDate}</td>
	       <td>${meal.mealTime}</td>
	    </tr>
	    </c:forEach>
    </table>
    </div>
</div>
</form>
</c:if>